<{includeq file="db:icmspoll_header.html"}>

<{if $resultlist}>
	<{if $icmspoll_index.header}>
        <{$icmspoll_index.header}>
    <{/if}>
    <{if $icmspoll_index.heading}>
        <{$icmspoll_index.heading}>
    <{/if}>
    
    <{if $icmspoll_pagenav }><!-- pagination control -->
		<{$icmspoll_pagenav}>
	<{/if}>
	<div class="polls_container">
		<{foreach item=poll from=$resultlist}>
			<{includeq file="db:icmspoll_polls.html"}>
		<{/foreach}>
	</div>
	<{if $icmspoll_pagenav }><!-- pagination control -->
		<{$icmspoll_pagenav}>
	<{/if}>
<{elseif $poll}>
	<div class="icmspoll_singlepoll">
		<h2>
			<{$poll.question}>
		</h2>
		<div class="singlepoll_description">
			<p style="font-size:80%;"><{$smarty.const._CO_ICMSPOLL_POLL_HAS_ENDED}>&nbsp;:&nbsp;<{$poll.end_time}></p>
			<{if $poll.dsc}>
			    <p>&nbsp;</p>
			    <{$poll.dsc}>
			    <p>&nbsp;</p>
			<{/if}>
		</div>
		<div class="icmspoll_morelink">
            <{$smarty.const._MD_ICMSPOLL_RESULTS_TOTALVOTES}> &nbsp;:&nbsp; <b><{$total_voters}></b>
            
	    <{if $icmspoll_is_admin}><br />
		<{$smarty.const._MD_ICMSPOLL_RESULTS_TOTALVOTES_REGISTERED}> &nbsp;:&nbsp; <b><{$total_registred}></b> <br />
		<{$smarty.const._MD_ICMSPOLL_RESULTS_TOTALVOTES_ANONS}> &nbsp;:&nbsp; <b><{$total_anonymous}></b> <br />
		<a href="#icmspoll_option_adminview" name="icmspoll_option_adminview" style="line-height:auto;" onclick ="jQuery('div.icmspoll_option_adminview').toggle(400);"><h6><{$smarty.const._CO_ICMSPOLL_ADMIN_SHOW_DETAILS}></h6></a>
	    <{/if}>
            
        </div>
		<div class="singlepoll_form">
		    <div class="poll_result">
		    	<div class="icmspoll_result_options">
	    			<{foreach item=option from=$options name=options}>
				    <div class="poll_option_sum">
	    				<div class="poll_option_txt">
	    					<{$option.text}> <small class="span_poll_result">(<{$option.endresult}>, <{$option.total_votes}> <{$smarty.const._CO_ICMSPOLL_OPTION_TOTALVOTES}>)</small>
	    				</div>
	    				
					<div class="icmspoll_clear_both">&nbsp;</div>
	    				<div class="result_option">
	    				   <div class="icmspoll_option_<{$option.color}> icmspoll_option_color" style="width:<{$option.endresult}>" >
	    				       &nbsp;
	    				   </div>
					</div>
	    				<{$poll.delimeter}>
	    				<{if $icmspoll_is_admin}>
	    				<div class="icmspoll_clear_both">&nbsp;</div>
					    <div style="display:none;border-radius: 4px 4px 4px 4px;" class="icmspoll_option_adminview">
						<div class="result_option_info">
						      <{$smarty.const._MD_ICMSPOLL_RESULTS_BY_OPTION_ANON}> &nbsp;:&nbsp; <{$option.anon_votes}> <br />
						      <{$smarty.const._MD_ICMSPOLL_RESULTS_BY_OPTION_USERS}> &nbsp;:&nbsp; <{$option.user_votes}> <br />
						      <{$smarty.const._MD_ICMSPOLL_RESULTS_BY_OPTION_TOTAL}> &nbsp;:&nbsp; <{$option.total_votes}> <br />
						</div>
					    </div>
	    				<{/if}>
				    </div>
	    			<{/foreach}>
    			</div>

			</div>
		</div>
		<div class="box">
			<div class="icmspoll_morelink">
			<{if $icms_isuser}>
			    <span class="more_polls_by"><a href="<{$icmspoll_url}>index.php?op=getPollsByCreator&uid=<{$poll.user_id}>"><img src="<{$icmspoll_images_url}>other-user-poll.png" title="<{$smarty.const._CO_ICMSPOLL_POLLS_GET_MORE_BY_USER}> <{$icms_uname}>" /></a>&nbsp;&nbsp;</span>
			<{/if}>
			<{if $user_can_submit}>
			    <span class="more_polls_by">
				<a href="<{$icmspoll_url}>polls.php?op=mod" title="<{$smarty.const._MD_ICMSPOLL_SUBMIT_POLL}>">
					<img src="<{$icmspoll_images_url}>add_poll_now.png" alt="<{$smarty.const._MD_ICMSPOLL_SUBMIT_POLL}>" title="<{$smarty.const._MD_ICMSPOLL_SUBMIT_POLL}>" />
				</a>
			</span>
			<{/if}>
			</div>
		</div>
	</div>
	<span class="icmspoll_button_bar">
		<a href="mailto:?subject=<{$smarty.const._MD_ICMSPOLL_MAILTO_SBJ}>&body=<{$smarty.const._MD_ICMSPOLL_MAILTO_BDY}><{$poll.itemURL}>" title="<{$smarty.const._MD_ICMSPOLL_MAILTO}>">
			<img style="vertical-align: middle;" src="<{$icmspoll_images_url}>mail.png" alt="<{$smarty.const._MD_ICMSPOLL_MAILTO}>" title="<{$smarty.const._MD_ICMSPOLL_MAILTO}>" />
		</a>
		<a href="<{$icmspoll_url}>print.php?print=result&poll_id=<{$poll.id}>" title="<{$smarty.const._MD_ICMSPOLL_PRINT}>" target="_blank">
			<img style="vertical-align: middle;" src="<{$icmspoll_images_url}>print.png" alt="<{$smarty.const._MD_ICMSPOLL_PRINT}>" title="<{$smarty.const._MD_ICMSPOLL_PRINT}>" />
		</a>
	<!--	
		<a href="<{$icmspoll_url}>print.php?print=pdf&poll_id=<{$poll.id}>" title="<{$smarty.const._MD_ICMSPOLL_PRINT_PDF}>" target="_blank">
			<img style="vertical-align: middle;" src="<{$icmspoll_images_url}>pdf.png" alt="<{$smarty.const._MD_ICMSPOLL_PRINT_PDF}>" title="<{$smarty.const._MD_ICMSPOLL_PRINT_PDF}>" />
		</a>
	-->
		<{if $icmspoll_is_admin}>
			<a href="<{$icmspoll_url}>print.php?print=log&poll_id=<{$poll.id}>&limitsel=all" title="<{$smarty.const._MD_ICMSPOLL_PRINT_LOG}>" target="_blank">
				<img style="vertical-align: middle;" src="<{$icmspoll_images_url}>log.png" alt="<{$smarty.const._MD_ICMSPOLL_PRINT_LOG}>" title="<{$smarty.const._MD_ICMSPOLL_PRINT_LOG}>" />
			</a>
		<{/if}>
		<{if $poll.userCanEditAndDelete}>
			<{$poll.editItemLink}>
			<{$poll.deleteItemLink}>
		<{/if}>
	</span>
<{elseif $results_by_creator}>
	<{if $icmspoll_index.header}>
        <{$icmspoll_index.header}>
    <{/if}>
    <{if $icmspoll_index.heading}>
        <{$icmspoll_index.heading}>
    <{/if}>
    
	<h1><{$smarty.const._MD_ICMSPOLL_RESULTS_MORE_BY_UNAME}> &nbsp; <{$username}></h1>
	<{if $icmspoll_pagenav }><!-- pagination control -->
		<{$icmspoll_pagenav}>
	<{/if}>
	<div class="polls_container">
		<{foreach item=poll from=$results_by_creator}>
			<{includeq file="db:icmspoll_polls.html"}>
		<{/foreach}>
	</div>
	<{if $icmspoll_pagenav }><!-- pagination control -->
		<{$icmspoll_pagenav}>
	<{/if}>
<{/if}>
<{includeq file="db:icmspoll_footer.html"}>